PMIS coarsening implementation on device - #2037
Open
yhmtsai wants to merge 6 commits into
Open
Conversation
MarcelKoch
self-requested a review
July 6, 2026 12:11
MarcelKoch
requested changes
Jul 6, 2026
| weight[row] = dist(gen); | ||
| } | ||
| } | ||
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( |
Member
There was a problem hiding this comment.
nit:
Suggested change
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( | |
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( |
|
|
||
|
|
||
| template <typename ValueType> | ||
| void initialize_random_weight(std::shared_ptr<const DefaultExecutor> exec, |
Member
There was a problem hiding this comment.
Shouldn't the next kernel be adapted to use this?
| randlib::uniform_rand_vector(gen, num, weight); | ||
| randlib::destroy(gen); | ||
| } | ||
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( |
Member
There was a problem hiding this comment.
nit:
Suggested change
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( | |
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( |
| }); | ||
| }); | ||
| } | ||
| GKO_INSTANTIATE_FOR_EACH_NON_COMPLEX_VALUE_TYPE_BASE( |
Comment on lines
+13
to
+15
| #include "common/hipda_hip/base/math.hpp" | ||
| #include "common/hipda_hip/base/runtime.hpp" | ||
| #include "common/hipda_hip/base/types.hpp" |
|
|
||
| class Pmis : public CommonTestFixture { | ||
| protected: | ||
| using Mtx = gko::matrix::Dense<value_type>; |
pratikvn
reviewed
Jul 7, 2026
Comment on lines
+28
to
+34
| exec->get_queue()->submit([&](sycl::handler& cgh) { | ||
| cgh.parallel_for(sycl::range<1>(n), [=](sycl::item<1> idx) { | ||
| std::uint64_t offset = idx.get_linear_id(); | ||
| oneapi::dpl::minstd_rand engine(seed, offset); | ||
| oneapi::dpl::uniform_distribution<device_type<ValueType>> distr(0, | ||
| 1); | ||
| work[idx] = distr(engine); |
Member
There was a problem hiding this comment.
Can you check if this is correct ? I think n should be num ? And work should be weight etc
| exec, | ||
| [] GKO_KERNEL(auto row, auto tid, auto row_ptrs, auto col_idxs, | ||
| auto values) { | ||
| auto maxabs = zero(abs(values[0])); |
Member
There was a problem hiding this comment.
Maybe zero<remove_complex<ValueType>>() instead ?
| { | ||
| GKO_NOT_IMPLEMENTED; | ||
| auto num = trans_strong_dep->get_size()[0]; | ||
| array<float> random(exec, num); |
Member
There was a problem hiding this comment.
Suggested change
| array<float> random(exec, num); | |
| array<ValueType> random(exec, num); |
Co-authored-by: Pratik Nayak <pratikvn@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows #2035 to add device implementation.
I also add some potential improvement we can try in the comments.
TODO: